<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //单价
        var book = 59;
        var pen = 30;
        var clas = 199;
        var milk = 68;
        //数量
        var bookmoney = 0;
        var penmoney = 0;
        var clasmoney = 0;
        var milkmoney = 0;
        //计算
        var book1 = prompt('请输入购买的《javaScript》书的数量',2);
        var booknum = Number(book1);
        if (booknum == 1) {
            bookmoney = 1 * book * 0.9;
        } else if (booknum == 2) {
            bookmoney = 2 * book * 0.8;
        } else if (booknum == 3) {
            bookmoney = 3 * book * 0.7;
        } else {
            bookmoney = booknum * book * 0.65;
        }
        var pen1 = prompt('请输入购买的钢笔的数量',3);
        var pennum = Number(pen1);
        if (pennum == 1) {
            penmoney = 1 * pen * 0.9;
        } else if (pennum == 2) {
            penmoney = 2 * pen * 0.8;
        } else if (pennum == 3) {
            penmoney = 3 * pen * 0.7;
        } else {
            penmoney = pennum * pen * 0.65;
        }
        var clas1 = prompt('请输入购买的眼睛的数量',1);
        var clasnum = Number(clas1);
        if (clasnum == 1) {
            clasmoney = 1 * clas * 0.9;
        } else if (clasnum == 2) {
            clasmoney = 2 * clas * 0.8;
        } else if (clasnum == 3) {
            clasmoney = 3 * clas * 0.7;
        } else {
            clasmoney = clasnum * clas * 0.65;
        }
        var milk1 = prompt('请输入购买的眼睛的数量',4);
        var milnum = Number(milk1);
        if (milnum == 1) {
            milkmoney = 1 * milk * 0.9;
        } else if (milnum == 2) {
            milkmoney = 2 * milk * 0.8;
        } else if (milnum == 3) {
            milkmoney = 3 * milk * 0.7;
        } else {
            milkmoney = milnum * milk * 0.65;
        }
        //总价
        var zong = milkmoney + clasmoney + penmoney + bookmoney
        document.write("总价是:" + zong)
    </script>
</head>
<body>
    
</body>
</html>